/// <summary>
/// 用来截取小数点后nleng位
/// </summary>
/// <param name="sString">sString原字符串。</param>
/// <param name="nLeng">nLeng长度。</param>
/// <returns>处理后的字符串。</returns>
public string VarStr(string sString, int nLeng)
{
int index = sString.IndexOf(".");
if (index == -1 || index + nLeng >= sString.Length)
return sString;
else
return sString.Substring(0, (index + nLeng + 1));
}
转载于:https://www.cnblogs.com/juexin/archive/2012/09/04/2670367.html